<template>
	<view class="page-height">
		<i-top-bar id="top-bar" title="消息通知"></i-top-bar>
		<view class="page-content">
			<text class="title">{{title}}</text>
			<text class="time">{{createtime}}</text>
			<view class="html-view">
				<text>{{content}}</text>
			</view>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				id: '',
				title: '',
				createtime: '',
				content: '',
			}
		},
		onLoad(option) {
			const params = JSON.parse(decodeURIComponent(option.params))
			this.id = params.id
			this.title = params.title
			this.content = params.content
			this.createtime = params.createtime
			this.newsCheck()
		},
		onPageScroll(e) {
			const bgOpacity = (e.scrollTop - 0) / 80
			if (bgOpacity > 0) {
				this.bgOpacity = bgOpacity
			} else {
				this.bgOpacity = 0
			}
		},
		methods: {
			newsCheck() {
				const params = {
					id: this.id
				}
				this.api.post("/api/user/newsCheck", { params: params }).then(res => {
					console.log(res);
				}).catch(err => {
					this.apiErr(err)
				}).finally(() => {
					this.loadingHide();
				})
			},

		}

	}
</script>

<style lang="scss" scoped>
	.page-height {
		background-size: 100% auto;
		background-color: #ffffff;
	}

	.page-content {
		position: relative;
		display: flex;
		flex-direction: column;
		padding: 30rpx 40rpx;
	}

	.title {
		color: #000000;
		font-size: 32rpx;
	}

	.time {
		font-size: 28rpx;
		color: #333333;
		padding: 24rpx 0;
	}


	.html-view {
		font-size: 28rpx;

	}
</style>